package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import pojo.OrderDto;
import server.ReletServer;

public class ReletServlet  extends HttpServlet {
	public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
	
		  System.out.println("reletServlet");
		  String roomNum = request.getParameter("reletRoom");
		  String preDay = request.getParameter("preDay");
		  System.out.println("roomNum"+roomNum);
		  System.out.println("preDay"+preDay);
		  
		  ReletServer relet = new ReletServer();
		  
		  OrderDto order = relet.reletRoom(roomNum, preDay);
		  
		  HttpSession session = request.getSession();
		  session.setAttribute("relet", order);
		  response.sendRedirect("/hotel/checkOut.jsp");
	}

}
